package com.powernode.api.pojo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 页面投资记录所需要的数据，两张表
 */
public class PhoneBidInfo implements Serializable {
    /*投资记录表*/
    private Integer id;
    private BigDecimal bidMoney;
    private Date bidTime;
    /*用户表*/
    private String phone;
    /*页面显示的 日期数据*/
    private String showTime;


    public String getPhone() {
        /*脱敏： 将 敏感数据 进行遮掩操作 */
        if (phone!=null&&phone.length()==11){
            phone=phone.substring(0,3)+"******"+phone.substring(7);
        }else {
            phone="******************";
        }
        return phone;
    }

    /*将 日期类型 转换为 字符串*/
    public String getShowTime() {
        if (this.bidTime!=null){
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            showTime  = format.format(this.bidTime);
        }
        return showTime;
    }

    @Override
    public String toString() {
        return "PhoneBidInfo{" +
                "id=" + id +
                ", bidMoney=" + bidMoney +
                ", bidTime=" + bidTime +
                ", phone='" + phone + '\'' +
                ", showTime='" + showTime + '\'' +
                '}';
    }

    public void setShowTime(String showTime) {
        this.showTime = showTime;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public BigDecimal getBidMoney() {
        return bidMoney;
    }

    public void setBidMoney(BigDecimal bidMoney) {
        this.bidMoney = bidMoney;
    }

    public Date getBidTime() {
        return bidTime;
    }

    public void setBidTime(Date bidTime) {
        this.bidTime = bidTime;
    }



    public void setPhone(String phone) {
        this.phone = phone;
    }
}
